/** COPYRIGHT(C) 2008. Loc Phan. All Rights Reserved.
    A class that take in a sentence
    @author Loc Phan
    @version 1.01 2008-11-11
*/

public class Sentence
{
   /**Constructs a sentence
    * 
    * @param input a string
    */
   public Sentence(String input)
   {
      input = input.toLowerCase().trim();
      letters = input.toCharArray();
   }
   
   /*
    * Method to determine whether a sentence is a palindrome (reads
    * the same forward and backward
    * @return true if the strings is a palindrome, false otherwise 
    */
   public boolean isPalindrome()
   {
      boolean answer = false;
      for(int i=0;i<(letters.length/2);i++)
      {
         if(letters[i]==letters[letters.length-i-1])
         {
            answer = true;
         }
         else
         {
            return false;
         }
      }
      return answer;
   }
   
   private char[] letters;
}
